package com.rulin.asp.business.statistics;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rulin.asp.sso.entity.UserUtils;

@Controller
@RequestMapping("/statisticsController")
public class StatisticsController {

	@Autowired
	private StatisticsService statisticsService;
	
	@RequestMapping(value = "/openMyStatistics.html", method = RequestMethod.GET)
	public String openMyStatistics(Model model){
		return "business/reports/mystatics";
	}
	
	@RequestMapping(value = "/getMyListIn5Days.json", method = RequestMethod.GET)
	@ResponseBody
	public List<MyStatisticsResultBean> getMyListIn5Days(){
		List<MyStatisticsResultBean> list = statisticsService.getMyStatisticsIn5Days(UserUtils.getUser().getAccount());
		return list;
	}
}
